#include "Obstacle.h"
#include "MyGL.h"
#include "Vec2.h"

void Obstacle::Draw()
{
	Engine::Vec3 topL, topR, bottomL, bottomR;

	Engine::Vec3 pos = m_pos;

	topL.x = m_aabb.min.x;
	topL.z = m_aabb.min.z;

	topR.x = m_aabb.max.x;
	topR.z = m_aabb.min.z;

	bottomL.x = m_aabb.min.x;
	bottomL.z = m_aabb.max.z;

	bottomR.x = m_aabb.max.x;
	bottomR.z = m_aabb.max.z;

	glPushMatrix();
		glColor3f(1.0f, 1.0f, 1.0f);
		glBegin(GL_TRIANGLES);
			glVertex3fv(topL.ToArray());
			glVertex3fv(topR.ToArray());
			glVertex3fv(bottomL.ToArray());

			glVertex3fv(bottomL.ToArray()); 
			glVertex3fv(topR.ToArray());
			glVertex3fv(bottomR.ToArray());
		glEnd();
	glPopMatrix();
}